package org.netty.push.server.message.handler;

import org.netty.push.core.proto.DataRequestMsg;
import org.netty.push.core.proto.handler.MessageHandler;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.stereotype.Component;

import io.netty.channel.ChannelHandlerContext;

@Component
public class DataRequestHandler implements MessageHandler<DataRequestMsg> {
	Logger logger=LoggerFactory.getLogger(DataRequestHandler.class);
	@Override
	public void handle(ChannelHandlerContext ctx, DataRequestMsg msg) {
		System.err.println(msg.getId());
		logger.debug("message is {}",msg);
	}

	@Override
	public boolean supported(Object msg) {
		return DataRequestMsg.class.isAssignableFrom(msg.getClass());
	}

}
